<!doctype html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.min.css" rel="stylesheet" />
		<link href="css/common.css" rel="stylesheet" />
		<style>
			.container{
				background: #FFFFFF;
				height: 100%;
				/*overflow: hidden;*/
			}
			#main{
			    position: relative;
			    width: 55%;
			    margin:20rem auto 15rem;
			}
			h1{
			    display: inline;
			    position: relative;
			    bottom: 2rem;
			    left: 1rem;
			    font-size:3rem;
			}
			#loginCode{
				height: 5rem;
				font-size: 3rem;
				line-height: 5rem;
				margin-top: 1rem;
				width:94%
            }
			.company{
				position: relative;
			    left: 50%;
			    color: #CCCCCC;
			    display: inline-table;
			    -webkit-transform:translate(-50%,0%);
			}
		</style>
	</head>

	<body>
		<div class='container'>
			<div id="main" class="mui-content">
				<div class="mui-input-row">
					<img class="logo" src="img/logo.png" style="margin-left:-1.2rem;"/><h1>自动采血记录识别系统</h1>
			    	<input id="loginCode" onblur="setFocus('loginCode')" type="text" class="mui-input-clear" placeholder="扫码登录..." autofocus="autofocus">
			    	<img src="img/login.png" style="position: relative;left: 50%;">
				</div>
			</div>
			<p class="company">© 2017和元达  techviewinfo.com</p>	
		</div>
		<script src="js/mui.min.js"></script>
		<script src="js/common.js"></script>
		<script type="text/javascript">
			var baseUrl = CONFIG.baseUrl;
			
			mui.plusReady(function(){
				document.getElementById('loginCode').addEventListener('change',function() {
					login(this.value);
				});
				mui('.mui-input-row').on('tap','.logo',function(){
					mui.openWindow({
						url: 'log.html'
					});
				})
				//自动更新
				svn("1.2","http://172.16.95.74:8888/zdcx.html")//zdcx.html服务器地址
			});

			function login(LoginInfo) {
				document.getElementById('loginCode').value='';
				RequestByPost('UserLogin', new Array('LoginInfo'), new Array(LoginInfo), baseUrl, 'http://HIS.org/', new Array('Request'), function() {
					var data = getResult(xmlhttp.responseText, 'UserLoginResult');
					if(data.ReturnVal == 1) {
						mui.openWindow({
							url: 'query.html',
							extras: data
						});
					} else if(data.ReturnVal == -1) {
						mui.alert('未查询到该用户', '提示', '确定');
					} else {
						mui.alert('登录失败，请重试', '提示', '确定');
					}
				});
			}
		</script>
	</body>
</html>